{% extends "base.html" %}


{% block title %}{{ section.title }}{% endblock title %}


{% block header_logo %}
<p class="header-title">{{ config.title }} | {{ section.title }}</p>
{% endblock header_logo %}


{% block content %}


<!-- List parent -->
<div>
  <p>Navigation</p>
  {% if section.ancestors | length > 0 %}
  {% set parent = section.ancestors | last %}
  {% set parent_path = parent | as_str %}
  {% set parent_section = get_section(path=parent_path) %}
  <ul>
    <li>
      <a href="{{ parent_section.permalink }}">Back up</a>
    </li>
  </ul>
  {% else%}
  <ul>
    <li>
      <a href=".">up</a>
    </li>
  </ul>
  {% endif %}
</div>


<!-- Table of Contents -->
{% if section.toc %}
<div>
  <p>Table of Contents</p>
  <ul>
    {% for h1 in section.toc %}
    <li>
      <a href="{{ h1.permalink | safe }}">{{ h1.title }}</a>
      {% if h1.children %}
      <ul>
        {% for h2 in h1.children %}
        <li>
          <a href="{{ h2.permalink | safe }}">{{ h2.title }}</a>
        </li>
        {% endfor %}
      </ul>
      {% endif %}
    </li>
    {% endfor %}
  </ul>
</div>
{% endif %}


{{ section.content | safe }}


{% endblock content %}
